package cn.gov.cus.rmftquartz.aspect;

import cn.gov.cus.rmftquartz.annotation.Log;
import cn.gov.cus.rmftquartz.common.Result;
import cn.gov.cus.rmftquartz.entity.RmftHitResultVo;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author wxming.
 * @date 2018/3/15.
 */
@Log(modelName = "风险类型代码表维护")
@Controller
@RequestMapping("/paraListType")
public class ParaListTypeController {

    @Log(operateNote = "更改风险类型")
    @RequestMapping("/doUpdate")
    @ResponseBody
    public String doUpdate(@ModelAttribute RmftHitResultVo vo){
        try{
            //调用mapper或service做操作的代码

            return new Result(true,"修改成功！").toString();
        }catch (DuplicateKeyException e){
            return new Result(false,"该风险类型已存在！").toString();
        }
    }

    @Log(operateNote = "删除风险类型")
    @RequestMapping("/delPara")
    @ResponseBody
    public int delPara(@RequestParam String riskType){
        //retrun paraService.remove(riskType);
        return 1;
    }
}
